package com.cqut.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;







import com.cqut.dao.PendingReviewJudgeMapper;
import com.cqut.dto.LimitShowDTO;
import com.cqut.service.IPendingReviewJudgeService;

@Service 
public class PendingReviewJudgeService implements IPendingReviewJudgeService {
	 
	@Resource(name="pendingReviewJudgeMapper")
    private PendingReviewJudgeMapper pendingReviewJudgeMapper;
   
	/**
     * 根据条件获得列表
     * @param judgeName 专家名
     * @param subordinate_units 单位
     * **/
	public List<Map<String, Object>> findJudgeList(String judgeName ,String subordinate_units,LimitShowDTO limitShowDTO) {
		return pendingReviewJudgeMapper.findJudgeListByLimit(judgeName,subordinate_units,limitShowDTO.calculateStart(),limitShowDTO.calculateEnd());
	}
    
	/**
     * 根据条件获得列表条数
     * @param judgeName 专家名
     * @param subordinate_units 单位
     * **/
	public long findCountOfPendingReviewJudges(String judgeName ,String subordinate_units){
		return pendingReviewJudgeMapper.findCountByLimit(judgeName,subordinate_units);
	}
	
	/**
	 * 审核通过
	 * @param ids
	 * **/
	public boolean passPendingReviewJudges(String[] ids){
		return (pendingReviewJudgeMapper.passJudges(ids)>0);
	}
	
	/**
	 * 审核退回
	 * @param ids
	 * **/
	public boolean retreatPendingReviewJudges(String[] ids){
		return (pendingReviewJudgeMapper.retreatJudges(ids)>0);
	}

	/**
	 * 专家详情
	 * @param judgeId
	 * **/
	public Map<String, Object> pendingReviewJudgeDetail(String judgeId){
		return pendingReviewJudgeMapper.judgeDetail(judgeId);
	}

}